OBJS_SERVER=Server.o servidor.o RequestHandler.o DBGestor.o
OBJS_CLIENT=Client.o cliente.o

OBJS_COMMON= ColaMsg.o Logger.o LockFile.o ConcurrencyFiles.o SignalHandler.o

CC=g++
CFLAGS=-g -Wall -Wreorder -I.

vpath %.cpp

all: $(OBJS_COMMON) $(OBJS_CLIENT) $(OBJS_SERVER)
	
%.o: %.cpp
	$(CC) $(CFLAGS) -c -o $@ $<

server: $(OBJS_SERVER) $(OBJS_COMMON)
	g++ -o $@ $^ $(CFLAGS)

client: $(OBJS_CLIENT) $(OBJS_COMMON)
	g++ -o $@ $^ $(CFLAGS)


.PHONY: clean

all: server client

clean:
	rm -f *.o server client

